package com.xiaoyu.lanling.feature.vip.model

import `in`.srain.cube.request.JsonData
import com.xiaoyu.base.utils.JsonUtil
import java.io.Serializable

class VipProduct(jsonData: JsonData) : Serializable {
    val vipInfo = VipInfo(jsonData)
    val products = JsonUtil.convertToList(jsonData.optJson("productList")) { rawData -> ProductItem(rawData, vipInfo) }
    val privileges = JsonUtil.convertToList(jsonData.optJson("privilegeList")) { rawData -> PrivilegeItem(rawData) }
}